added a check for OS_WIN32 link with libgw32c to provide dl* functions on
authorMichael Schumacher <schumaml@cvs.gnome.org>
Thu, 1 Sep 2005 22:11:45 +0000 (22:11 +0000)
committerMichael Schumacher <schumaml@src.gnome.org>
Thu, 1 Sep 2005 22:11:45 +0000 (22:11 +0000)
2005-09-01  Michael Schumacher  <schumaml@cvs.gnome.org>

* configure.ac: added a check for OS_WIN32
* babl/Makefile.am: link with libgw32c to provide dl* functions on
win32
* babl/babl-extension.c: added definitions of dl* function forwin32
* tests/Makefile.am: removed -ldl for win32

ChangeLog
babl/Makefile.am
babl/babl-extension.c
configure.ac
tests/Makefile.am

index 4191e1ac373787b99260be1cfc33ad2e180cfb08..26e7e03a3838897e5e693dc2d529377259376c87 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-09-01  Michael Schumacher  <schumaml@cvs.gnome.org>
+
+       * configure.ac: added a check for OS_WIN32
+       * babl/Makefile.am: link with libgw32c to provide dl* functions on
+       win32 
+       * babl/babl-extension.c: added definitions of dl* function forwin32
+       * tests/Makefile.am: removed -ldl for win32
+
 2005-09-01  Sven Neumann  <sven@gimp.org>
 
        * tests/Makefile.am (TESTS_ENVIRONMENT): set BABL_PATH to include
index 469a4a35b3fb0beeba7aaab9595770119247d3e8..2ca82e73b5250afc56d37cd15175914381ace2ca 100644 (file)
@@ -1,5 +1,10 @@
 ## Source directory
 
+if OS_WIN32
+win32_libs = -lgw32c -lole32 -luuid -lwsock32
+no_undefined = -no-undefined
+endif
+
 SUBDIRS = base
 
 c_sources =                            \
@@ -39,11 +44,13 @@ INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/babl/base
 lib_LTLIBRARIES= libbabl.la
 libbabl_la_SOURCES= $(h_sources) $(c_sources)
 libbabl_la_LIBADD=\
-       base/libbase.la
+       base/libbase.la \
+       ${win32_libs}
 
 libbabl_la_LDFLAGS= \
        -version-info $(BABL_LIBRARY_VERSION) \
-       -release $(BABL_RELEASE)
+       -release $(BABL_RELEASE) \
+       ${no_undefined}
 
 EXTRA_DIST :=                  \
        .cvsignore
index 30164a0ec7ed7708a11ebf434a7fa36dd38c227d..9fbac8a98b9119df7103a08e7bb7af4efc57f132 100644 (file)
@@ -44,7 +44,6 @@
 #include <string.h>
 #include <stdarg.h>
 
-
 static int   each_babl_extension_destroy (Babl *babl, void *data);
 
 static Babl *babl_extension_current_extender = NULL;
@@ -139,7 +138,15 @@ destroy_hook (void)
 #include <sys/stat.h>
 #include <unistd.h>
 
+#ifndef OS_WIN32
 #include <dlfcn.h>
+#else
+void  *dlopen(const char *, int);
+void  *dlsym(void *, const char *);
+int    dlclose(void *);
+char  *dlerror(void);
+#endif
+
 #ifndef RTLD_NOW
 #define RTLD_NOW 0
 #endif
index e0e3b392df0ef8f682ecccee89ead38326a28788..bd7d3aa016858fbc32af2670ee1de5951e71818c 100644 (file)
@@ -52,6 +52,78 @@ AM_CONDITIONAL(HAVE_INKSCAPE, test "x$INKSCAPE" != "xno")
 AC_PATH_PROG(W3M, w3m, no)
 AM_CONDITIONAL(HAVE_W3M, test "x$W3M" != "xno")
 
+###########################
+# Check target architecture
+###########################
+
+AC_MSG_CHECKING([for target architecture])
+case x"$target" in
+  xNONE | x)
+    target_or_host="$host" ;;
+  *)
+    target_or_host="$target" ;;
+esac
+AC_MSG_RESULT([$target_or_host])
+
+case "$target_or_host" in
+  i*86-*-*)
+    have_x86=yes
+    AC_DEFINE(ARCH_X86, 1, [Define to 1 if you are compiling for ix86.])
+    ;;
+  x86_64-*-*)
+    have_x86=yes
+    AC_DEFINE(ARCH_X86, 1, [Define to 1 if you are compiling for ix86.])
+    AC_DEFINE(ARCH_X86_64, 1, [Define to 1 if you are compiling for amd64.])
+    ;;
+  ppc-*-* | powerpc-*)
+    have_ppc=yes
+    AC_DEFINE(ARCH_PPC, 1, [Define to 1 if you are compiling for PowerPC.])
+    ;;
+  ppc64-*-* | powerpc64-*)
+    have_ppc=yes
+    AC_DEFINE(ARCH_PPC, 1, [Define to 1 if you are compiling for PowerPC.])
+    AC_DEFINE(ARCH_PPC64, 1, [Define to 1 if you are compiling for PowerPC64.])
+    ;;
+  *)
+    ;;
+esac
+
+
+#################
+# Check for Win32
+#################
+
+AC_MSG_CHECKING([for some Win32 platform])
+case "$target_or_host" in
+  *-*-mingw* | *-*-cygwin*)
+    platform_win32=yes
+    ;;
+  *)
+    platform_win32=no
+    ;;
+esac
+AC_MSG_RESULT([$platform_win32])
+AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")
+
+AC_MSG_CHECKING([for native Win32])
+case "$target_or_host" in
+  *-*-mingw*)
+    os_win32=yes
+    PATHSEP=';'
+    ;;
+  *)
+    os_win32=no
+    PATHSEP=':'
+    ;;
+esac
+AC_MSG_RESULT([$os_win32])
+AC_SUBST(PATHSEP)
+
+AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")
+AC_DEFINE(OS_WIN32, 1, "Define to 1 if you are compiling for Microsoft Windows.")
+
+AM_CONDITIONAL(OS_UNIX, test "$os_win32" != "yes")
+
 dnl ===========================================================================
 
 AC_DEFINE_UNQUOTED(BABL_PATH, "~/.babl-$BABL_API_VERSION:/usr/local/lib/babl-$BABL_API_VERSION:/usr/lib/babl-$BABL_API_VERSION", [search path for babl extensions (default value of enviroment variable)])
index 4f631a8ba6694638a0ac4068398db2dcca2acc55..71b750905a23e353586fa7b912c9e61cf1d8ee5b 100644 (file)
@@ -1,3 +1,8 @@
+if OS_WIN32
+else
+dl = -ldl
+endif
+
 TESTS =                                \
        grayscale_to_rgb        \
        rgb_to_bgr              \
@@ -21,7 +26,8 @@ models_SOURCES              = models.c
 
 
 AM_CFLAGS = -I$(top_srcdir) -I$(top_srcdir)/babl
-LDADD = $(top_builddir)/babl/libbabl.la -lm -ldl
+
+LDADD = $(top_builddir)/babl/libbabl.la -lm ${dl}
 
 noinst_PROGRAMS =      \
        introspect      \